﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="js/jquery-1.4.min.js" type="text/javascript"></script>
    <script type="text/javascript">

        UTIL = {
            fire: function (d, a, b) {
                var c = FOO;
                a = (a === undefined) ? "init" : a;
                if (d !== "" && c[d] && typeof c[d][a] == "function") {
                    c[d][a](b)
                }
            },
            loadEvents: function () {
                var a = document.body.id;
                UTIL.fire("common");
                UTIL.fire("common", a);
                UTIL.fire("common", "finalize")
            }
        };

        FOO = {
            common: {
                init: function () {
                    alert("init");
                },
                finalize: function () {
                    alert("finalize");
                }
            }
        };

        //$(window).load(UTIL.loadEvents);

        $(window).load(function () {
            console.log("load");
        });

        $(document).ready(function () {
            console.log("ready");
        });

    </script>
</head>
<body>

</body>
</html>
